import request from '@/utils/http'

interface BaseResult<T = any> {
    [propName: string]: any
}

export class LoginMethod {
    // 发送手机验证码
    static sendSmsCode(params: object) {
        return request.get<BaseResult>({
            url: '/promoter/user/getVerifyCode',
            params
        })
    }
    // 发送手机验证码
    static smsCodeLogin(params: object) {
        return request.post<BaseResult>({
            url: '/promoter/user/loginBySms',
            params
        })
    }
    //账号密码登录
    static Login(data: object) {
        return request.post<BaseResult>({
            url: '/promoter/user/loginByPassword',
            data
        })
    }
    //获取用户信息
    static getUserInfo() {
        return request.get<BaseResult>({
            url: '/promoter/user/getUserInfo'
        })
    }
}